<?php
/**
 * 
 * @author Paolo Bertuzzo
 *
 */
namespace Catalog\Form;

/**
 */
class WallStickerForm extends AbstractProductForm
{
    
    /**
     */
    public function __construct($name, $options)
    {
        parent::__construct($name, $options);
        
        // Add the "sticker size" element
        $this->add(array(
            'name' => 'size',
            'attributes' => array(
                'type' => 'size_element',
                'attribute' => parent::getProductAttribute('size'),
                'values' => parent::getProductAttributeValues('size')
            )
        ));
        
        // Add the "sticker color" element
        $this->add(array(
            'name' => 'color',
            'attributes' => array(
                'type' => 'color_element',
                'attribute' => parent::getProductAttribute('color'),
                'values' => parent::getProductAttributeValues('color')
            )
        ));
    }

    /**
     * (non-PHPdoc)
     * @see \Catalog\Form\AbstractProductForm::getProductAttributes()
     */
    protected function getProductAttributes()
    {
        $attributes = array();
        
        $attributes = array_merge($attributes, array('color' => parent::getProductAttributeValues('color')));
        $attributes = array_merge($attributes, array('size' => parent::getProductAttributeValues('size')));
                        
        return $attributes;
    }
    
}

?>